/*
 ============================================================================
 Page	     : 264
 Name        : usehotel.c
 Date	     : 20210404
 Author      : Hbue 18060333
 Copyright   : Your copyright notice
 Description : 房间费率程序
 		与程序清单9.10一起编译
 ============================================================================
 */

#include <stdio.h>
#include "hotel.h"		/* 定义符号常量，声明函数 */
int main(void)
{
	int nights = 0;
	double hotel_rate = 0;
	int code = 0;

	while((code = menu()) != QUIT)
	{
		switch(code)
		{
			case 1:
				hotel_rate = HOTEL1;
				break;
			case 2:
				hotel_rate = HOTEL2;
				break;
			case 3:
				hotel_rate = HOTEL3;
				break;
			case 4:
				hotel_rate = HOTEL4;
				break;
			default:
				hotel_rate = 0.0;
				printf("Oops!\n");
				break;
		}
		nights = getnights();
		showprice(hotel_rate, nights);
	}
	printf("Thank you and goodbye.\n");

	return 0;
}

